package com.cbd.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;

/**
 * 是否出租 0：没有出租 1：出租
 * 
 */
@Entity
@Table(name="personalcarport")
@Validated
public class Personalcarport implements Serializable{
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int carportID;
	/**
	 * 产权证编号
	 * 
	 */
	@Column(name="carportNO")
	@NotEmpty(message="不能为空")
	@Length(max=10,min=3,message="长度必须为3-10位")
	private String carportNO;
	/**
	 * 车位所在小区地址
	 * 
	 */
	@Column(name="carportAddress")
	@NotEmpty(message="不能为空")
	@Length(max=20,min=3,message="长度必须为3-20位")
	private String carportAddress;
	/**
	 * 小区车位编号carNO
	 * 
	 */
	@Column(name="carNO")
	@NotEmpty(message="不能为空")
	@Length(max=11,min=3,message="长度必须为5-11位")
	private String carNO;
	/**
	 * 产权证图片
	 * 
	 */
	@Column(name="carportPic")
	private String carportPic;
	/**
	 * 申请 0：没有通过   1：通过 true
	 * 
	 */
	@Column(name="type")
	private boolean type;
	/**
	 * 是否出租 0：没有出租 1：已租出
	 */
	@Column(name="isrent")
	private boolean isrent;
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="ladyID")
	private Landlady landlady;
	/**
	 * @Fields applyTime : 发布租车时间
	 */ 
	@Column(name="applyTime")
	private Date  applyTime;
	public int getCarportID() {
		return carportID;
	}

	public void setCarportID(int carportID) {
		this.carportID = carportID;
	}

	public String getCarportNO() {
		return carportNO;
	}

	public void setCarportNO(String carportNO) {
		this.carportNO = carportNO;
	}

	public String getCarportAddress() {
		return carportAddress;
	}

	public void setCarportAddress(String carportAddress) {
		this.carportAddress = carportAddress;
	}

	public String getCarNO() {
		return carNO;
	}

	public void setCarNO(String carNO) {
		this.carNO = carNO;
	}

	public String getCarportPic() {
		return carportPic;
	}

	public void setCarportPic(String carportPic) {
		this.carportPic = carportPic;
	}

	public boolean isType() {
		return type;
	}

	public void setType(boolean type) {
		this.type = type;
	}

	public boolean isIsrent() {
		return isrent;
	}

	public void setIsrent(boolean isrent) {
		this.isrent = isrent;
	}

	public Landlady getLandlady() {
		return landlady;
	}

	public void setLandlady(Landlady landlady) {
		this.landlady = landlady;
	}

	public Date getApplyTime() {
		return applyTime;
	}

	public void setApplyTime(Date applyTime) {
		this.applyTime = applyTime;
	}
	
}